package com.xxx.blog.controller;

import com.xxx.blog.domain.Param;
import com.xxx.blog.service.IParamService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/param")
@Api(tags = "param接口")
public class ParamController {
    @Autowired
    IParamService ParamService;
    @GetMapping()
    public Map<String, String> map(){
        List<Param> all = ParamService.findAll();
        Map<String,String> map=new HashMap<>();
        for (Param param : all) {
            map.put( param.getParamKey(), param.getParamValue());
        }
        return map;
    }
}
